package com.sc.nft.mapper;

import com.sc.nft.entity.UserPrizeDrawRecords;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.sc.nft.entity.dto.NumberQueryListDTO;
import com.sc.nft.entity.vo.NumberQueryListVO;
import com.sc.nft.entity.vo.WinnersListVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.ArrayList;
import java.util.List;

/**
 * 用户抽奖号码表(sc_user_prize_draw_records)数据Mapper
 *
 * @author Sun
 * @description 由 Mybatisplus Code Generator 创建
 * @since 2023-09-14 11:58:29
 */
@Mapper
public interface UserPrizeDrawRecordsMapper extends BaseMapper<UserPrizeDrawRecords> {

    List<WinnersListVO> listWinners(@Param("id") Long id);
    List<NumberQueryListVO> numberQueryList(@Param("numberQueryListDTO") NumberQueryListDTO numberQueryListDTO);
    /**
     * 处理掉未中奖的用户
     *
     * @param activityId
     */
    void losingLottery(@Param("activityId") Long activityId, @Param("list") List<Integer> list);

    /**
     * 获取活动中重复的竞猜数据
     *
     * @param activityId
     * @return
     */
    List<Integer> getActivityIdRepeat(@Param("activityId") Long activityId);
    /**
     * 获取中奖的数据
     *
     * @param activityId
     * @param number
     * @param overturn
     * @return
     */
    List<UserPrizeDrawRecords> winAPrizeLottery(@Param("activityId") Long activityId, @Param("result") Integer result, @Param("number") Integer number, @Param("overturn") Boolean overturn);
    void losingLotteryAll(@Param("activityId") Long activityId);
    /**
     * 抽奖人数
     *
     * @param id
     * @return
     */
    Long numberPeopleDrawn(@Param("id") Long id);
    /**
     * 抽奖次数
     *
     * @param id
     * @return
     */
    Long numberDraws(@Param("id") Long id);

    /**
     * 获取此活动中奖的号码
     * @param activityId
     * @param v1
     * @param v2
     * @param v3
     * @param v4
     * @param v5
     * @return
     */
    List<UserPrizeDrawRecords> getWinningNumberByActivityIdAndNumber(@Param("activityId") Long activityId, @Param("v1") Integer v1, @Param("v2")Integer v2, @Param("v3") Integer v3, @Param("v4")Integer v4, @Param("v5")Integer v5,@Param("notInIds") ArrayList<Long> notInIds);
}
